home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 1 / Meeting Pearls Vol 1 (1994).iso / installed_progs / dev / flexcat / c_c_v21.sd < prev    next >
Encoding:
Text File  |  1994-05-30  |  1.7 KB  |  80 lines

  1. ##stringtype C
  2. ##shortstrings
  3. /****************************************************************
  4.    This file was created automatically by `FlexCat V1.1'
  5.    Do NOT edit by hand!
  6. ****************************************************************/
  7.  
  8. #include <clib/locale_protos.h>
  9.  
  10. #ifdef AZTEC_C
  11. #include <pragmas/locale_lib.h>
  12. #endif /*   AZTEC_C            */
  13.  
  14. #if defined(__SASC)  ||  defined(_DCC)  ||  defined(__MAXON__)
  15. #include <pragmas/locale_pragmas.h>
  16. #endif    /*  __SASC  ||    _DCC  ||  __MAXON__    */
  17.  
  18. #ifdef __GNUC__
  19. #include <inline/locale.h>
  20. #endif    /*  __GNUC__    */
  21.  
  22.  
  23.  
  24.  
  25. static LONG %b_Version = %v;
  26. static const STRPTR %b_BuiltInLanguage = (STRPTR) %l;
  27.  
  28. struct FC_Type
  29. {   LONG   ID;
  30.     STRPTR Str;
  31. };
  32.  
  33.  
  34. const struct FC_Type _%i = { %d, %s };
  35.  
  36.  
  37. static struct Catalog *%b_Catalog = NULL;
  38.  
  39. void Open%bCatalog(struct Locale *loc, STRPTR language)
  40. { LONG tag, tagarg;
  41.   extern struct Library *LocaleBase;
  42.   extern void Close%bCatalog(void);
  43.  
  44.   Close%bCatalog(); /* Not needed if the programmer pairs Open%bCatalog
  45.                and Close%bCatalog right, but does no harm.  */
  46.  
  47.   if (LocaleBase != NULL  &&  %b_Catalog == NULL)
  48.   { if (language == NULL)
  49.     { tag = TAG_IGNORE;
  50.     }
  51.     else
  52.     { tag = OC_Language;
  53.       tagarg = (LONG) language;
  54.     }
  55.     %b_Catalog = OpenCatalog(loc, (STRPTR) "%b.catalog",
  56.                 OC_BuiltInLanguage, %b_BuiltInLanguage,
  57.                 tag, tagarg,
  58.                 OC_Version, %b_Version,
  59.                 TAG_DONE);
  60.   }
  61. }
  62.  
  63. void Close%bCatalog(void)
  64. { if (LocaleBase != NULL)
  65.   { CloseCatalog(%b_Catalog);
  66.   }
  67.   %b_Catalog = NULL;
  68. }
  69.  
  70. STRPTR Get%bString(APTR fcstr)
  71. { STRPTR defaultstr;
  72.   LONG strnum;
  73.  
  74.   strnum = ((struct FC_Type *) fcstr)->ID;
  75.   defaultstr = ((struct FC_Type *) fcstr)->Str;
  76.  
  77.   return(%b_Catalog ? GetCatalogStr(%b_Catalog, strnum, defaultstr) :
  78.               defaultstr);
  79. }
  80.